package com.bwie.system.controller;

import com.bwie.common.domain.Goods;
import com.bwie.common.result.Result;
import com.bwie.system.service.GoodsService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("goods")
@CrossOrigin
public class GoodsController {


    @Autowired
    GoodsService goodsService;

    @PostMapping("goodslist")
    private Result goodslist(@RequestBody Goods goods){
       PageInfo<Goods> goodsPageInfo= goodsService.goodslist(goods);
       return Result.success(goodsPageInfo);
    }

    @PostMapping("goodslists")
    private Result goodslists(@RequestBody Goods goods){
        PageInfo<Goods> goodsPageInfos= goodsService.goodslists(goods);
        return Result.success(goodsPageInfos);
    }
}
